__author__ = 'East'


list_1 = [1, 4, 5, 7, 3, 6, 7, 9]
list_1 = set(list_1)

list_2 = set([2, 6, 0, 66, 22, 8])

print(list_1, list_2)

# 交集
print(list_1.intersection(list_2))

# 并集
print(list_1.union(list_2))

# 差 1 - 2
print(list_1.difference(list_2))

# 子集
print(list_1.issubset(list_2))

# 父集
print(list_1.issuperset(list_2))

# 对称差集
print(list_1.symmetric_difference(list_2))

print('------------------------------')

list_3 = set([1, 3, 7])
list_4 = set([5, 6, 8])
print(list_3.isdisjoint(list_4))

# 交集
print(list_1 & list_2)

# 并集
print(list_1 | list_2)

# 差集
print(list_1 - list_2)

# 对称差集
print(list_1 ^ list_2)

list_1.add(99)
list_1.update([888, 666])
list_1.remove(99)
list_1.pop()
list_1.discard('ddd')
print(list_1)